<template>
  <h1>孙子：{{ money }}</h1>
  <button @click="clickHandle">改money</button>
</template>
<script>
import { inject } from 'vue'
export default {
 name: 'App',
  setup() {
    const money = inject('money')
    const setMoney = inject('setMoney')

    const clickHandle = () => {
      setMoney(10)
    }
    return {
      money,
      clickHandle
    }
  }
}
</script>